package com.sgb.kjwl.view.ui.adapter.manage;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.member.entity.OperatingResultsEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class OperatingResultsAdapter extends BaseRecycleAdapter<OperatingResultsEntity> {

    public OperatingResultsAdapter(Context context, List<OperatingResultsEntity> data) {
        super(context, R.layout.item_operating_results, data);
    }

    @Override
    public void convert(ItemViewHolder holder, OperatingResultsEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        ImageView imStart = holder.itemView.findViewById(R.id.im_state);
        switch (entity.getStatus()) {
            case 0:
                Glide.with(context).load(R.mipmap.operating_status_0).into(imStart);
                break;
            case 1:
                Glide.with(context).load(R.mipmap.operating_status_1).into(imStart);
                break;
            case 2:
                Glide.with(context).load(R.mipmap.operating_status_2).into(imStart);
                break;
            default:
                imStart.setVisibility(View.GONE);
                break;
        }
    }
}
